package com.mofang.powerdekorhelper.adapter;

import android.content.Context;

import com.mofang.powerdekorhelper.R;
import com.mofang.powerdekorhelper.base.recycleview.BaseRecycleViewAdapter;
import com.mofang.powerdekorhelper.base.recycleview.BaseViewHolder;
import com.mofang.powerdekorhelper.model.PresentManagerTask;

import java.util.List;

/**
 * Created by luofei on 2017/9/3 0003.
 * 说明：
 */

public class PresentUerManagerTaskAdapter extends BaseRecycleViewAdapter {

    public PresentUerManagerTaskAdapter(List<?> data, Context mContext, int layoutId) {
        super(data, mContext, layoutId);
    }

    @Override
    protected <T> void convert(BaseViewHolder holder, T bean, int position) {
        PresentManagerTask.Data data = (PresentManagerTask.Data) bean;

        double signRate = data.getSign_rate();
        if (signRate != 0) {
            holder.setText(R.id.current_manager_task_invate, (int) signRate + "");
        } else {
            holder.setText(R.id.current_manager_task_invate, "0");
        }
        holder.setText(R.id.current_manager_task_sale, data.getActivity_num() + "");

        double inviteSignRate = data.getInvite_sign_rate();

        if (inviteSignRate != 0) {
            holder.setText(R.id.current_manager_task_invate_finish, (int) inviteSignRate + "");
        } else {
            holder.setText(R.id.current_manager_task_invate_finish, "0");
        }

        holder.setText(R.id.current_manager_task_sale_finish, data.getInvite_activity_num() + "");
        holder.setText(R.id.current_manager_task_activity_name, data.getActivity_name() + "");
    }

    @Override
    public int getItemCount() {
        return 1;
    }
}
